<?php

include_once('logic/action/Action.php');

class ThumbAction extends Action
{
	public function perform()
	{

		$photos = new PhotosDAO();

		$id = HttpRequest::getRequest("id");
		$ratio = HttpRequest::getRequest("rat");
		$data = $photos->getData($id);

		if (is_array($data))
		{
			header("Content-length: $data[0]");
			header("Content-type: $data[1]");
			// header("Content-Disposition: attachment; filename=$name");
			Thumb::getThumb($data[2], $data[1], $ratio);

		}
	}
}

?>
